package ItemTest;

import static org.junit.Assert.*;

import java.util.List;

import item.Itemstrackingsystem;
import item.itsProjects;

import org.junit.Test;

public class ItemstrackingsystemTest {

	@Test
	public void test() {
		Itemstrackingsystem aItem = new Itemstrackingsystem();
		assertNotNull(aItem);
	}
	
	@Test
	public void testSearch(){
		Itemstrackingsystem aItem = new Itemstrackingsystem();
		aItem.createProject("oscar");
		aItem.createProject("eli");
		List<itsProjects> p = aItem.getProjects();
		int a = aItem.getAproject(p.get(0));
		assertEquals(0,a);
	}
	
	@Test
	public void testRemover(){
		Itemstrackingsystem aItem = new Itemstrackingsystem();
		aItem.createProject("oscar");
		aItem.createProject("eli");
		List<itsProjects> p = aItem.getProjects();
		assertEquals(2,p.size());
		int a = aItem.getAproject(p.get(0));
		p.remove(a);
		assertEquals(1,p.size());
	}

}
